<HTML>
<HEAD>
	<TITLE>Calendar</TITLE>
<style>
.calendarA{position:absolute;top:70;left:10}
.calendarB{position:absolute;top:240;left:10}
.calendarOptions{position:absolute;top:410;left:10}

.title{font-family:arial,sans-serif;font-size:14px;font-weight:bold;text-decoration:none;color:ffffff}
.gray{font-family:arial,sans-serif;font-size:12px;font-weight:bold;color:eeeecc}
.boldwhite{font-family:arial,sans-serif;font-size:12px;font-weight:bold;color:ffffff}
.boldneon{font-family:arial,sans-serif;font-size:12px;font-weight:bold;color:0066ff}
.boldblue{font-family:arial,sans-serif;font-size:12px;font-weight:bold;color:003399}
.regularwhite{font-family:arial,sans-serif;font-size:11px;color:ffffff}
.regularblue{font-family:arial,sans-serif;font-size:11px;color:003399}
.regularneon{font-family:arial,sans-serif;font-size:11px;color:0066ff;text-decoration:none}
</style>
<style>
a{cursor-style:hand}
body{cursor-style:arrow}
</style>

<SCRIPT LANGUAGE="JavaScript">
var month="";
var day="";
var year="";
var now="";
var monthNames = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");

function setToday() {
	now   = new Date();
	day   = now.getDate();
	month = now.getMonth();
	year  = now.getYear();
	if (year < 2000) {
		year = year + 1900;
	}
	this.focusDay = day;
	displayCalendar(month, year);
}

function setPreviousMonth() {
	day   = 0;
	if (month == 0) {
		month = 11;
		if (year > 1000) {
			year--;
		}
	} else {
		month--;
	}
	displayCalendar(month, year);
}

function setNextMonth() {
	day   = 0;
	if (month == 11) {
		month = 0;
		year++;
	} else {
		month++;
	}
	displayCalendar(month, year);
}

function displayCalendar(month, year) {
	var thisDay;
	month = parseInt(month);
	year = parseInt(year);
	var i = 0;
	var days = getDaysInMonth(month+1,year);
	var firstOfMonth = new Date (year, month, 1);
	var startingPos = firstOfMonth.getDay();
	days += startingPos;

	var myValue = "";
	myValue  = '<table cellpadding="2" cellspacing="2" border="0"><tr><td colspan="7" class="boldblue">'+monthNames[month]+' '+year+'</td></tr>';
	myValue += '<tr><td class="regularblue" regularneonalign="right">Su</td> <td class="regularblue" regularneonalign="right">Mo</td> <td class="regularblue" regularneonalign="right">Tu</td> <td class="regularblue" regularneonalign="right">We</td> <td class="regularblue" regularneonalign="right">Th</td> <td class="regularblue" regularneonalign="right">Fr</td> <td class="regularblue" regularneonalign="right">Sa</td></tr>';
	myValue += '<tr>';
	for (i = 0; i < startingPos; i++) {
		myValue += "<td></td>";
	}
	for (i = startingPos; i < days; i++) {

		if ( i%7 == 0 ) {
			myValue += '<tr height="20">';
		}
		myValue += "<td align='right'>";
		thisDay = i-startingPos+1;
		myValue += '<a href="javascript:opener.assignDate(\''+eval(month+1)+'/'+thisDay+'/'+year+'\');window.close()"><font class="regularneon">'+thisDay+'</font></a></td>';
		if ( i%7 == 6 ) {
			myValue += "</tr>";
		}
	}
	myValue += "</tr></table>";

	if (document.all) {
		document.all.calendarA.innerHTML = myValue;
	} else {
		document.layers.calendarA.document.open();
		document.layers.calendarA.document.writeln(myValue);
		document.layers.calendarA.document.close();
	}

	if (month == 11) {
			var monthB = 0;
			var yearB = year + 1;
	} else {
		var monthB = month +1;
		var yearB = year;
	}

	days = getDaysInMonth(monthB+1,yearB);
	firstOfMonth = new Date (yearB, monthB, 1);
	startingPos = firstOfMonth.getDay();
	days += startingPos;

	myValue = '<table cellpadding="2" cellspacing="2" border="0"><tr><td colspan="7" class="boldblue">'+monthNames[monthB]+' '+yearB+'</td></tr>';
	myValue += '<tr><td class="regularblue" regularneonalign="right">Su</td> <td class="regularblue" regularneonalign="right">Mo</td> <td class="regularblue" regularneonalign="right">Tu</td> <td class="regularblue" regularneonalign="right">We</td> <td class="regularblue" regularneonalign="right">Th</td> <td class="regularblue" regularneonalign="right">Fr</td> <td class="regularblue" regularneonalign="right">Sa</td></tr>';
	myValue += '<tr>';
	for (i = 0; i < startingPos; i++) {
		myValue += "<td></td>";
	}
	for (i = startingPos; i < days; i++) {

		if ( i%7 == 0 ) {
			myValue += '<tr height="20">';
		}
		myValue += "<td align='right'>";
		thisDay = i-startingPos+1;
		myValue += '<a href="javascript:opener.assignDate(\''+eval(monthB+1)+'/'+thisDay+'/'+yearB+'\');window.close()"><font class="regularneon">'+thisDay+'</font></a></td>';
		if ( i%7 == 6 ) {
			myValue += "</tr>";
		}
	}
	myValue += '</tr></table>';

	if (document.all) {
		document.all.calendarB.innerHTML = myValue;
	} else {
		document.layers.calendarB.document.open();
		document.layers.calendarB.document.writeln(myValue);
		document.layers.calendarB.document.close();
	}
}

function getDaysInMonth(month,year)  {
var days;
if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12)  days=31;
else if (month==4 || month==6 || month==9 || month==11) days=30;
else if (month==2)  {
if (isLeapYear(year)) { days=29; }
else { days=28; }
}
return (days);
}
function isLeapYear (Year) {
if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) {
return (true);
} else { return (false); }
}
// End -->
</SCRIPT>



<head>
	<title>Untitled</title>
</head>

<BODY bgcolor="ffffff" marginheight="0" marginwidth="0" topmargin=0 leftmargin=0 onLoad="setToday();">
<table cellpadding="10" cellspacing="0" border="0" width="100%">
<tr bgcolor="#003399"><td height="60" class="regularwhite" valign="top"><font class="title">Calendar</font><br>
Select a date.
</td><td valign="top" align="right"><a href="javascript:window.close()"><font class="boldwhite">Close</font></a>
</td></tr></table>
<div id="calendarA" class="calendarA"></div>
<div id="calendarB" class="calendarB"></div>
<div id="calendarOptions" class="calendarOptions"><a href="javascript:setPreviousMonth()"><font class="regularblue">Previous month</font></a> &nbsp;|&nbsp; <a href="javascript:setNextMonth()"><font class="regularblue">Next month</font></a></div>

</body>
</html>

